package com.lc.afbx.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

import java.io.Serializable;

/**
 * Created by Administrator on 2016/6/6.
 */
@HttpInlet(Conn.INLET_API_TEAM_INDEX)
public class GetApiTeam extends BaseAsyGet<GetApiTeam.Info> {
    public String userid;
    public GetApiTeam(AsyCallBack<GetApiTeam.Info> asyCallBack) {
        super(asyCallBack);
    }

    protected Info parser(JSONObject jsonObject) {

        TOAST = jsonObject.optString("message");

        if (jsonObject.optInt("code") == 200) {

            Info info = new Info();
            JSONObject o = jsonObject.optJSONObject("data");
            Data d = new Data();

            d.id = o.optString("id");
            d.nickname = o.optString("nickname");
            d.level = o.optString("level");
            d.team_id = o.optString("team_id");
            d.team = o.optString("team");

            info.data = d;
            return info;
        }
        return null;
    }

    public static class Info {

        public Data data;
    }

    public static class Data implements Serializable {
//        "id": "4",
//                "nickname": "凯奇",
//                "level": "业务经理",
//                "team_id": "2",
//                "team": "晴天二组"

        public String id, nickname, level, team_id, team;
    }
}
